home *** CD-ROM | disk | FTP | other *** search
Wrap
<%@ page language="java" import=" java.util.*, com.jproxy.site.mbeans.JMXInvocator, com.jproxy.site.mbeans.config.*, com.jproxy.site.ejbeans.interfaces.ISaleFormula, com.jproxy.site.ejbeans.interfaces.IProduct, com.jproxy.site.*" %> <jsp:useBean id="buycustomers" scope="request" class="com.jproxy.site.customers.Buy"/> <% buycustomers.request(pageContext); buycustomers.ses.setNewHit(pageContext, "hits", "Customer Buy Page", null); %> <% int licenses = 1; int purchasedLicenses = 0; int support_licenses = 0; String productName = ""; String productID = buycustomers.getParameter("productid").trim(); if(buycustomers.getParameter("licenses").trim().length()>0) licenses = new Integer(buycustomers.getParameter("licenses")).intValue(); if(buycustomers.getParameter("purchased-licenses").length()>0) purchasedLicenses = new Integer(buycustomers.getParameter("purchased-licenses")).intValue(); if(buycustomers.getParameter("support_licenses").length()>0) support_licenses = new Integer(buycustomers.getParameter("support_licenses")).intValue(); if(productID.length()>0) productName = buycustomers.product.getProductName(); else { %> <span class="h9Verdana">Failed to obtain Product Id! Please report this error to <a class="h8VerdanaBold" href="mailto:postmaster@jproxy.com">postmaster@jproxy.com</a></span> <% return; } // find out the number of licenses requested if(licenses <= 0) licenses = 1; // find out the number of licenses requested if(support_licenses < 0) support_licenses = 1; boolean isDisabled = false; String host = "http://"+request.getServerName()+":"+request.getServerPort(); String customerName = buycustomers.customer.getCustomerName(); ISaleFormula formula = (ISaleFormula)buycustomers.getSaleFormulaByProductID(productID); int invoice = 0; int customerId = 0; int StandardSupportDuration = 30; int AdvancedSupportDuration = 90; int firstLicensePrice = formula.getFirstLicense(); int additionalLicensePrice = formula.getAdditionalLicense(); //if(purchasedLicenses>0) // firstLicensePrice = additionalLicensePrice; // calculate the TOTAL AMOUNT based on the number of licenses and the pricing model double lic_cost = firstLicensePrice * buycustomers.formula.getDiscount(); lic_cost += (licenses-1) * additionalLicensePrice * buycustomers.formula.getDiscount(); double sup_cost = lic_cost * buycustomers.formula.getSupport() * support_licenses; if(request.getParameter("submit_recalculate")!=null) { } if(request.getParameter("submit_purchase")!=null && request.getParameter("error")==null) { %> <jsp:forward page="purchase.jsp"/> <% } %> <!-- HEADER --> <jsp:include page="header.jsp" flush="true"> <jsp:param name="name" value="ePortal - Purchasing Licenses and Technical Support"/> <jsp:param name="pageId" value="buy"/> </jsp:include> <!-- MAIN PANEL --> <% ConfigMBean mbean = (ConfigMBean)JMXInvocator.getMBean("JProxy:service=JProxyConfigMBean", ConfigMBean.class); //String productName = mbean.get("com.jproxy.proxy.name") + " " + mbean.get("com.jproxy.proxy.version"); String invoiceStr = mbean.get("com.jproxy.commerce.invoice"); try{ invoice = Integer.parseInt(invoiceStr); } catch(Exception e){ invoice = 15; } %> <% String sProductDescr; %> <br> <table class="h8Verdana" cellpadding="5" width="100%" border="0"> <!-- Prolog --> <tr> <td> You're about to purchase <span class="h8VerdanaBold"><%=buycustomers.product.getProductName()%></span> licenses. Please enter the desired number of software license and the number of <a target='home' href="/main/support.jsp#advanced">Advanced Support Packages</a>, which are optional. The software comes with the <a target='home' href="/main/support.jsp#standard">Standard Support Package</a> free of charge. <p> If you elect to purchase Advanced Support Package please select the number of the packages you would like to purchase. If you would like to get longer support please increase the number of support packages to get the desired support duration. <p> Once yo've entered desired number of licenses and support packages, please press the <Recalcualte> button to get the updated price. <p> </td> </tr> <tr> <td> <form method="get" action="buy.jsp"> <table class="h9Verdana" width="100%" border="0" bgcolor="9c9cff" cellpadding="1" cellspacing="0"> <tr><td> <%=productName%> </td></tr> <tr><td> <table class="h9Verdana" width="100%" border="0" bgcolor="white" cellpadding="5" cellspacing="3" > <tr> <td align="left" width="65%" bgcolor="#f6f6f6"> Number of Licenses: <INPUT TYPE=HIDDEN NAME="customer-id" VALUE="<%=buycustomers.customerID%>"> </td> <td align="left" bgcolor="#f3f8ff"> <input type="input" name="licenses" value="<%=licenses%>" size="3"> </td> <td align="right" width="35%" bgcolor="#f3f8ff"> Subtotal: <input type="text" name="total" READONLY value="$<%=lic_cost%>" size="10"> </td> </tr> </table> </td></tr> <!-- begin title --> <tr><td> Advanced Support Package </td></tr> <!-- begin prices --> <tr><td> <table class="h9Verdana" width="100%" border="0" bgcolor="white" cellpadding="5" cellspacing="3" > <tr> <td align="left" width="65%" bgcolor="#f6f6f6"> Number of Support Cycles: </td> <td align="left" bgcolor="#f3f8ff"> <input type="input" name="support_licenses" value="<%=support_licenses%>" size="3"> </td> <td align="right" width="35%" bgcolor="#f3f8ff"> Subtotal: <input type="text" name="total" READONLY value="$<%=sup_cost%>" size="10"> </td> </tr> </table> </td></tr> <!-- begin prices --> <tr><td> <table class="h9Verdana" width="100%" border="0" bgcolor="white" cellpadding="5" cellspacing="3" > <tr> <td align="left" width="68%" bgcolor="#f3f8ff"> <INPUT TYPE=SUBMIT NAME=submit_recalculate WIDTH="20" VALUE="Recalculate"> <INPUT TYPE=HIDDEN NAME="productid" VALUE="<%=buycustomers.product.getID()%>"> <INPUT TYPE=HIDDEN NAME="purchased-licenses" VALUE="<%=purchasedLicenses%>"> </td> <td align="right" width="32%"bgcolor="#f3f8ff"> Grand Total: <input type="text" name="total" READONLY value="$<%=lic_cost + sup_cost%>" size="10"> </td> </tr> </table> </td></tr> </td></tr> </table> </form> <table class="h9Verdana" width="100%" border="0" bgcolor="white" cellpadding="5" cellspacing="3" > <tr> <td align="left" bgcolor="#f3f8ff"> <% if (support_licenses == 0) { sProductDescr = productName + " with Standard Support Package for " + Integer.toString(StandardSupportDuration) + " days"; } else { sProductDescr = productName + " and Advanced Support Package for " + Integer.toString(support_licenses * AdvancedSupportDuration) + " days"; } %> <span class="h8Verdana">Your selection is: <%=licenses%> license(s) for <%=sProductDescr%>.</span> </td> </tr> <tr> <td class="h8Verdana" align="left"> Before submitting your purchase order please read our <a class="h8VerdanaBold" target="_blank" href="<%=JSPRes.path%>/main/resources/docs/eula.pdf">License agreement</a></span> and also review our <a class="h8VerdanaBold" target="_blank" href="/main/content/refundpolicy.html">refund policy</a> </td> </tr> <tr> <td align="right"> <!-- begin purchase button --> <% String headerHTML = "<font size=30 color=#6331CE>JProxy</font>"; headerHTML += "<font size=10 color=#9C00FF>.com</font>"; String footerHTML = "<font size=2><em>Copyright 2001-2002, JProxy</em></font>"; %> <% sProductDescr = "Licenses # : "+licenses+" ($"+lic_cost+")"; if (support_licenses == 0) { sProductDescr += "<br>"+productName + " and Standard Support Package for " + Integer.toString(StandardSupportDuration) + " days : $"+sup_cost; } else { sProductDescr += "<br>"+productName + " and Advanced Support Package for " + Integer.toString(support_licenses * AdvancedSupportDuration) + " days : $"+sup_cost; } %> <!-- begin purchase button --> <FORM METHOD=POST ACTION="https://secure.authorize.net/gateway/transact.dll"> <INPUT TYPE=HIDDEN NAME="number_of_licenses" VALUE="<%=licenses%>"> <INPUT TYPE=HIDDEN NAME="customer-id" VALUE="<%=buycustomers.customerID%>"> <INPUT TYPE=HIDDEN NAME="parent-id" VALUE="<%=buycustomers.ses.getLogin().getID()%>"> <INPUT TYPE=HIDDEN NAME="x_amount" VALUE="<%=lic_cost + sup_cost%>"> <INPUT TYPE=HIDDEN NAME="x_Version" VALUE="3.0"> <INPUT TYPE=HIDDEN NAME="x_Login" VALUE="jproxyllc"> <INPUT TYPE=HIDDEN NAME="x_Show_Form" VALUE="PAYMENT_FORM"> <INPUT TYPE=HIDDEN NAME="x_Cust_ID" VALUE="<%=customerId%>"> <INPUT TYPE=HIDDEN NAME="x_Invoice_Num" VALUE="<%=invoice%>"> <INPUT TYPE=HIDDEN NAME="x_Description" VALUE="<%=sProductDescr%>"> <!-- INPUT TYPE=HIDDEN NAME="x_Logo_URL" VALUE="http://jproxy.com/main/resources/jproxy.gif" --> <INPUT TYPE=HIDDEN NAME="x_Header_HTML_Payment_Form" VALUE="<%=headerHTML%>"> <INPUT TYPE=HIDDEN NAME="x_Footer_HTML_Payment_Form" VALUE="<%=footerHTML%>"> <INPUT TYPE=HIDDEN NAME="x_Receipt_Link_Method" VALUE="GET"> <INPUT TYPE=HIDDEN NAME="x_Receipt_Link_Text" VALUE="Click here to continue"> <INPUT TYPE=HIDDEN NAME="x_Receipt_Link_URL" VALUE="<%=host%>/main/customers/purchase.jsp;jsessionid=<%=request.getSession().getId()%>"> <INPUT TYPE=SUBMIT NAME=submit_purchase WIDTH="20" VALUE="Purchase"> <INPUT TYPE=HIDDEN NAME="productid" VALUE="<%=buycustomers.product.getID()%>"> </FORM> </td> </tr> </table> </td> </tr> <tr> <td> <p> </td> </tr> </table> <!-- FOOTER --> <jsp:include page="footer.jsp" flush="true"/>